package com.GlobalPaint.app.ui.Mine.Personal;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.GlobalPaint.app.R;
import com.GlobalPaint.app.utils.CommUtility;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class CompleteInformationActivity extends AppCompatActivity {

    @BindView(R.id.iv_goback)
    ImageView ivGoback;
    @BindView(R.id.tv_common_center)
    TextView tvCommonCenter;
    @BindView(R.id.tv_fresh)
    TextView tvFresh;
    @BindView(R.id.et_user)
    EditText etUser;
    @BindView(R.id.et_industry)
    EditText etIndustry;
    @BindView(R.id.et_company)
    EditText etCompany;
    @BindView(R.id.bt_submit)
    Button btSubmit;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_complete_information);
        ButterKnife.bind(this);
        initView();
    }

    private void initView() {
        tvCommonCenter.setText("完善信息");
        tvFresh.setVisibility(View.VISIBLE);
        tvFresh.setTextColor(Color.BLACK);
        tvFresh.setText("跳过");
    }

    @OnClick({R.id.iv_goback, R.id.tv_fresh, R.id.bt_submit})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_goback:
                finish();
                break;
            case R.id.tv_fresh:
                Intent intent = new Intent(CompleteInformationActivity.this, PasswordActivity.class);
                startActivity(intent);
                finish();
                break;
            case R.id.bt_submit:
                String name=String.valueOf(etUser.getText());
                if(TextUtils.isEmpty(name)){
                    CommUtility.ShowMsgShort(this, "请输入用户名");
                    return;
                }
                String Industry = String.valueOf(etIndustry.getText());
                if(TextUtils.isEmpty(Industry)){
                    CommUtility.ShowMsgShort(this, "请输入您的职业");
                    return;
                }
                String Company = String.valueOf(etCompany.getText());
                if(TextUtils.isEmpty(Company)){
                    CommUtility.ShowMsgShort(this, "请输入公司名称或从事行业");
                    return;
                }

                break;
        }
    }
}
